home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Synchronization.h
-
- Contains: Some classes useful for synchronizing multiple threads or tasks.
-
- Written by: Dave Falkenburg
-
- Copyright: © 1993 by Dave Falkenburg, all rights reserved.
-
- Change History (most recent first):
-
- */
-
- #ifndef _SYNCHRONIZATION_
- #define _SYNCHRONIZATION_
-
- #ifndef __THREADS__
- #include <Threads.h>
- #endif
-
-
- class TSimpleSemaphore
- {
- private:
- long fCounter;
- ThreadID fOwner;
- TList fWaitingList;
-
- public:
- TSimpleSemaphore(void);
- ~TSimpleSemaphore(void);
-
- OSErr Wait(void);
- OSErr Signal(void);
- };
-
- #endif
-